package io;

import java.io.*;

public class CopyDemo3 {
    public static void main(String[] args) throws IOException {
        //read()返回1字节的二进制信息，read(byte[] a)返回值为本次读取到了几个字节
        FileInputStream fis = new FileInputStream("传奇.gif");
        FileOutputStream fos = new FileOutputStream("传奇_cp.gif");
        BufferedInputStream bis = new BufferedInputStream(fis);
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        int d;
        while ((d = bis.read()) != -1){
            bos.write(d);
        }
        bis.close();
        bos.close();

    }


}
